<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
<style>
    div{
        width: 200px;
        height: 200px;
        background: red;
        animation: run 2s linear infinite alternate paused;
    }
    /*声明动画*/
    /*关键帧*/
    @keyframes run {
        /*初始状态*/
        from{
            width: 200px;
            height: 200px;
            background: red;
        }
        /*结束状态*/
        to{
            width: 400px;
            height: 400px;
            background: green;
        }
    }
    @keyframes run2 {
        /*初始状态*/
        0%{
            width: 200px;
            height: 200px;
            background: red;
        }
        20%{
            width: 400px;
            height: 200px;
            background: yellow;
        }
        /*结束状态*/
        100% {
            width: 400px;
            height: 400px;
            background: green;
        }
    }
</style>
</head>
<body>
    <div>

    </div>
</body>
</html>